<?php

namespace app\model;

use Illuminate\Database\Eloquent\Casts\Attribute;

class GameSellConfig extends Base
{

    protected $connection;
    protected $table = 'game_sell_config';

    public function __construct(array $attributes = [])
    {
        parent::__construct($attributes);
        $this->connection = config('database.connections.biqi_game.database');
    }

    public function allowType(): Attribute
    {
        return Attribute::make(
            get: fn(string $value) => json_decode($value, true),
        );
    }

    public function typeConfig(): Attribute
    {
        return Attribute::make(
            get: fn(string $value) => json_decode($value, true),
        );
    }

}